import * as types from '../actionTypes/articleTypes';
const initState = {
  // 频道数据
  channels: [],
  // 表格相关数据
  page: 1,
  pageSize: 10,
  articleList: [],
  count: 0,
};

export const article = (state = initState, action) => {
  switch (action.type) {
    case types.GET_ARTICLE_CHANNELS_LIST:
      return {
        ...state,
        channels: action.payload,
      };
    case types.GET_ARTICLE_LIST:
      return {
        ...state,
        ...action.payload,
      };

    default:
      return state;
  }
};
